﻿#region using

using System.Windows.Forms;

#endregion using

namespace T4_Eind_programma
{
    public partial class VulbatchScherm : Form
    {
        #region Constructor

        public VulbatchScherm(Mengbatch mijnMengbatch)
        {
            InitializeComponent();
            VulListViewMetVulBatches(mijnMengbatch);
        }

        #endregion Constructor

        private void VulListViewMetVulBatches(Mengbatch mijnMengbatch)
        {
            listViewVulBatch.Items.Clear();
            foreach (Vulbatch batch in mijnMengbatch.VulbatchList)
            {
                ListViewItem lv = new ListViewItem(mijnMengbatch.Nummer.ToString());
                lv.SubItems.Add(batch.Nummer.ToString());
                lv.SubItems.Add(batch.AantalVaten.ToString());
                lv.SubItems.Add(batch.Klaar.ToString());
                string apparaten = "";
                foreach (string item in batch.GebruikteApparaten)
                {
                    apparaten += item + " ";
                }
                lv.SubItems.Add(apparaten);
                listViewVulBatch.Items.Add(lv);
            }
        }
    }
}